package com.smrs.asn.enums;

import java.util.HashMap;
import java.util.Map;

import com.smrs.enums.StatusEnum;

/**
 * 用户状态枚举
 * @author Jonathan
 *
 */
public enum AsnStatusEnum {
	FRESH('1',"新建"),AUDITED('2',"已审核"),ACCOUNTED('3',"已过账"),DELETED('D',"删除"),CANCEL('C',"取消"),ALL('Z',"所有");
	
	private static final Map<Character, AsnStatusEnum> CACHE = new HashMap<Character, AsnStatusEnum>(){
		private static final long serialVersionUID = -8986866330615001847L;
		{
			for(AsnStatusEnum enu : AsnStatusEnum.values()){
				put(enu.getId(), enu);
			}
		}
	};
	private Character id;
	private String name;
	
	
	public Character getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	private AsnStatusEnum(Character status, String description) {
		this.id = status;
		this.name = description;
	}
	
	public Character getStatus() {
		return id;
	}
	public String getDescription() {
		return name;
	}
	
	public static AsnStatusEnum toEnum(Character id){
		return CACHE.get(id);
	}
}
